<?php /* Smarty version Smarty-3.1.6, created on 2018-01-10 15:29:51
         compiled from "D:/wamp/www/myshop/Admin/View\Role\assignauth.html" */ ?>
<?php /*%%SmartyHeaderCode:146205a541fb3ad6944-40209699%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '82db05fe34e48031ff28e82732abfd742ad80317' => 
    array (
      0 => 'D:/wamp/www/myshop/Admin/View\\Role\\assignauth.html',
      1 => 1515569386,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '146205a541fb3ad6944-40209699',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.6',
  'unifunc' => 'content_5a541fb3c3c14',
  'variables' => 
  array (
    'role_info' => 0,
    'auth_infoA' => 0,
    'v' => 0,
    'had_auth' => 0,
    'auth_infoB' => 0,
    'vv' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_5a541fb3c3c14')) {function content_5a541fb3c3c14($_smarty_tpl) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统HTML模板--模板之家 www.cssmoban.com</title>
<link href="<?php echo @ADMIN_CSS_PATH;?>
style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo @ADMIN_JS_PATH;?>
jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});
//顶级权限多选框的class为p+id,其子级权限多选框的class为s+pid
   $("td>input").click(function(){
   	if(this.checked){
   		//var pname=;
   		//alert(this.className.replace("p",""));
   		$(".s"+this.className.replace("p","")).attr("checked", true);
   	}else{
   		$(".s"+this.className.replace("p","")).attr("checked", false);
   	}
});
//选中任一次级权限，确保其顶级权限也会被选
$("td input").click(function(){
   	var cname=this.className;
   	if(this.checked){
   		if(!new RegExp("p").test(cname)){
   	  	$(".p"+cname.replace("s","")).attr("checked", true);
   		}
   	}
   	
});

});
$(document).ready(function(){
	//查找有多少行
	for(var i=1;i<$('tr').length;i++){
	//alert($("tr:eq("+i+")").children('td').length) ;
	//补齐每一行的格子
	var size=$("tr:eq("+i+")").children('td').length;
	for(var j=0;j<6-size;j++){
		//alert(6-$("tr:eq("+i+")").children('td').length);
		$("tr:eq("+i+")").append("<td><pre>		</pre></td>");
	}
	}
	});
function sub(){
	$("#form").submit();
}

</script>
</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">权限管理</a></li>
    <li><a href="#">角色列表</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li><span><img src="<?php echo @ADMIN_IMAGES_PATH;?>
t04.png" /></span>统计</li>
        </ul>
        
        <ul class="toolbar1">
        <li><span><img src="<?php echo @ADMIN_IMAGES_PATH;?>
t05.png" /></span>设置</li>
        </ul>
    
    </div>
    
    <form action="<?php echo @__SELF__;?>
" method="post" name="form" id="form">
    <input id="roleid" name="roleid" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['role_info']->value['id'];?>
"/>
    <table class="tablelist" border="1px">
    	<thead>
    	<tr>
        <th>顶级权限<i class="sort"><img src="<?php echo @ADMIN_IMAGES_PATH;?>
px.gif" /></i></th>
        <th colspan="5" style="text-align: center;">次顶级权限</th>
        </tr>
        </thead>
        <tbody>
        
        <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['auth_infoA']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value){
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
        <tr>
        <td><input type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
" name="authids[]" 
        	<?php if (in_array($_smarty_tpl->tpl_vars['v']->value['id'],$_smarty_tpl->tpl_vars['had_auth']->value)){?> checked="checked"<?php }?> class="p<?php echo $_smarty_tpl->tpl_vars['v']->value['id'];?>
" /><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
</td>
        <?php  $_smarty_tpl->tpl_vars['vv'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['vv']->_loop = false;
 $_smarty_tpl->tpl_vars['kk'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['auth_infoB']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['vv']->key => $_smarty_tpl->tpl_vars['vv']->value){
$_smarty_tpl->tpl_vars['vv']->_loop = true;
 $_smarty_tpl->tpl_vars['kk']->value = $_smarty_tpl->tpl_vars['vv']->key;
?>
        <?php if ($_smarty_tpl->tpl_vars['vv']->value['pid']==$_smarty_tpl->tpl_vars['v']->value['id']){?>
        <td><input type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['vv']->value['id'];?>
" name="authids[]" 
        	<?php if (in_array($_smarty_tpl->tpl_vars['vv']->value['id'],$_smarty_tpl->tpl_vars['had_auth']->value)){?> checked="checked"<?php }?> class="s<?php echo $_smarty_tpl->tpl_vars['vv']->value['pid'];?>
"/><?php echo $_smarty_tpl->tpl_vars['vv']->value['name'];?>
</td>
        <?php }?>
        <?php } ?>
        
        </tr> 
        <?php } ?>
                
        </tbody>
    </table>
    <div style="padding-top: 20px;text-align: center;">
    <input type="button" class="btn click" value="确认保存"/>
    </div>
   </form>
   
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="<?php echo @ADMIN_IMAGES_PATH;?>
ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" onclick="sub()"/>&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    
    </div>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>
<?php }} ?>